package net.wofly.sale.stock.domain;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * 商品入库
 *
 * @author lign
 * @version 1.0
 * @created 11-10月-2017 21:17:39
 */
@Data
@Entity
@Table(name = "sale_stock_instock")
@ApiModel(description = "商品入库")
public class InStock {
    
    @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
    @JoinColumn(name = "operateStockID")
    @ApiModelProperty(value = "入库详情",required = true)
    public List<InOutStockDetail> inOutStockDetails;
    @Id
    private String inStockID;
    /**
     * 审核人。审核人id
     */
    @ApiModelProperty(value = "审核人id")
    private String checker;
    /**
     * 入库人  仓管员id
     */
    @ApiModelProperty(value = "入库人", required = true)
    private String inStocker;
    /**
     * 入库类型
     */
    @ApiModelProperty(value = "入库类型(入库单=1;宴会退货=2;领料单=3;外购单=4;调拔单=5;)", required = true,allowableValues = "1,2,3,4,5")
    private Integer inStockType;

    /**
     * 审核人。审核人id
     */
    private Long modifyDate;
    /**
     * 单据照片
     */
    private String pic1;
    /**
     * 单据照片
     */
    private String pic2;
    /**
     * 单据照片
     */
    private String pic3;
    /**
     * 单据照片
     */
    private String pic4;
    /**
     * 单据号。入库类型对应的单据号
     */
    @ApiModelProperty(value = "入库单据号", required = true)
    private String proofID;
    
    
    private String warehouseID;

    /**
     * 入库人名称
     */
    @ApiModelProperty(value = "入库人名称", required = true)
    @Transient
    private String inStockerName;

    /**
     * 入库类型名称
     */
    @ApiModelProperty(value = "入库类型(入库单=1;宴会退货=2;领料单=3;外购单=4;调拔单=5;)", required = true,allowableValues = "1,2,3,4,5")
    @Transient
    private String inStockTypeStr;
    
    public InStock() {
        
    }
    @Override
    public void finalize() throws Throwable {
        
    }
}